package com.yuanrui.interview.server.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yuanrui.interview.server.dao.SensitiveWordsDao;
import com.yuanrui.interview.server.entity.po.SensitiveWords;
import com.yuanrui.interview.server.service.SensitiveWordsService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 敏感词表(SensitiveWords)表服务实现类
 *
 * @author makejava
 * @since 2024-07-30 16:29:21
 */
@Service("sensitiveWordsService")
public class SensitiveWordsServiceImpl extends ServiceImpl<SensitiveWordsDao, SensitiveWords> implements SensitiveWordsService {
    @Resource
    private SensitiveWordsDao sensitiveWordsDao;

    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    @Override
    public SensitiveWords queryById(Long id) {
        return this.sensitiveWordsDao.queryById(id);
    }



    /**
     * 新增数据
     *
     * @param sensitiveWords 实例对象
     * @return 实例对象
     */
    @Override
    public SensitiveWords insert(SensitiveWords sensitiveWords) {
        this.sensitiveWordsDao.insert(sensitiveWords);
        return sensitiveWords;
    }

    /**
     * 修改数据
     *
     * @param sensitiveWords 实例对象
     * @return 实例对象
     */
    @Override
    public SensitiveWords update(SensitiveWords sensitiveWords) {
        this.sensitiveWordsDao.update(sensitiveWords);
        return this.queryById(sensitiveWords.getId());
    }

    /**
     * 通过主键删除数据
     *
     * @param id 主键
     * @return 是否成功
     */
    @Override
    public boolean deleteById(Long id) {
        return this.sensitiveWordsDao.deleteById(id) > 0;
    }

    @Override
    public List<SensitiveWords> list(LambdaQueryWrapper<SensitiveWords> eq) {
        return List.of();
    }

    @Override
    public List<SensitiveWords> list(LambdaUpdateWrapper<SensitiveWords> eq) {
        return List.of();
    }

    @Override
    public void remove(LambdaUpdateWrapper<SensitiveWords> remove) {

    }
}
